﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace Model.Helpers
{
    public class Image
    {
        [Key]
        public int ImageID { get; set; }

        // The id of the entity this image belongs to
        public int EntityID { get; set; }

        public String Path { get; set; }

        public void SetRelativePath(String userName)
        {
            if (String.IsNullOrWhiteSpace(userName))
                throw new ArgumentNullException();
            this.Path = userName + "_" + Guid.NewGuid();
        }
    }
}
